package com.example.demo.dto.Admin;

public class AdminLoginResponseDto {
    private boolean success;
    private String message;
    private AdminLoginDataDto data;
    private int code;

    public AdminLoginResponseDto(boolean success, String message, AdminLoginDataDto data, int code) {
        this.success = success;
        this.message = message;
        this.data = data;
        this.code = code;
    }

    // Getters
    public boolean isSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public AdminLoginDataDto getData() {
        return data;
    }

    public int getCode() {
        return code;
    }
    // Setters (如果需要)
    public void setSuccess(boolean success) {
        this.success = success;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setData(AdminLoginDataDto data) {
        this.data = data;
    }

    public void setCode(int code) {
        this.code = code;
    }

    // 静态工厂方法
    public static AdminLoginResponseDto success(String token, AdminInfoDto adminInfo) {
        AdminLoginDataDto dataDto = new AdminLoginDataDto(token, adminInfo);
        return new AdminLoginResponseDto(true, "管理员登录成功", dataDto, 200);
    }

    public static AdminLoginResponseDto failure(String message, int code) {
        return new AdminLoginResponseDto(false, message, null, code);
    }
}
